<?php
require_once("../../model/loai_mon_an_model.php");
?>
<?php
require("../_layout/m_header.php");
 ?>
<br />
<br />
<br />
<?php
if(isset($_GET)&&isset($_GET['ma_loai']))
{
    $list=lay_loai_monan($_GET['ma_loai']);
    while($row=mysqli_fetch_row($list))
    {
?>  
<h3>Cập Nhật Loại Món Ăn</h3>
<form class="form-horizontal" method="post" action="../../controler/loai_mon_an_controller.php" role="form">
<div class="form-group">
    <div class="col-sm-10">
      <input type="hidden" hidden="1" class="form-control" name="ma_loai" value="<?php echo $row[0];  ?>"/>
    </div>
  </div>
<div class="form-group">
    <label for="inputLoai3" class="col-sm-2 control-label">Loại Món Ăn</label>
    <div class="col-sm-5">
      <input type="text" class="form-control" name="ten_loai" value="<?php echo $row[1];  ?>"/>
    </div>
  </div>
  <div class="form-group">
    <label for="inputLoai3" class="col-sm-2 control-label">Trạng Thái</label>
    <div class="col-sm-2">
      <select class="form-control" name="trang_thai">
      <?php if($row[2]==1)
      {
      echo "<option selected value='1'>Hoạt Động</option>";
      echo "<option value='0'>Khóa</option>";
      }
      else 
      {
      echo "<option value='1'>Hoạt Động</option>";
      echo "<option selected value='0'>Khóa</option>";
      }
       ?>

      </select>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" name="sua_loai_mon_an" class="btn btn-default">Cập Nhật</button> |
      <button type="submit" name="huy_loai" class="btn btn-default">Hủy</button>
    </div>
  </div>
</form>
<?php 
}
}
?>
<?php
require("../_layout/m_footer.php");
 ?>
